Skip to content

Conversation

@rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Oct 16, 2025

jsii-query can be used for fine-grained queries on a JSII assembly.

jsii-query <FILE> [QUERY...]

Queries a jsii file for its entries.

Positionals:
  FILE   path to a .jsii file or directory to load                      [string]
  QUERY  a query or filter expression to include or exclude items       [string]

Options:
      --help     Show help                                             [boolean]
      --version  Show version number                                   [boolean]
  -t, --types    after selecting API elements, show all selected types, as well
                 as types containing selected members [boolean] [default: false]
  -m, --members  after selecting API elements, show all selected members, as
                 well as members of selected types    [boolean] [default: false]
  -c, --closure  Load dependencies of package without assuming its a JSII
                 package itself                       [boolean] [default: false]

REMARKS
-------

There can be more than one QUERY part, which progressively filters from or adds
to the list of selected elements.

QUERY is of the format:

    <op><kind>[:<expression>]

Where:

    <op>          The type of operation to apply
             +    Adds new API elements matching the selector to the selection.
                  If this selects types, it also includes all type's members.
             -    Removes API elements from the current selection that match
                  the selector.
             .    Removes API elements from the current selection that do NOT
                  match the selector (i.e., retain only those that DO match
                  the selector).
    <kind>        Type of API element to select. One of 'type' or 'member',
                  or any of its more specific sub-types such as 'class',
                  'interface', 'struct', 'enum', 'property', 'method', etc.
                  Also supports aliases like 'c', 'm', 'mem', 's', 'p', etc.
    <expression>  A JavaScript expression that will be evaluated against
                  the member. Has access to a number of attributes like
                  kind, ancestors, abstract, base, datatype, docs, interfaces,
                  name, initializer, optional, overrides, protected, returns,
                  parameters, static, variadic, type. The types are the
                  same types as offered by the jsii-reflect class model.

This file evaluates the expressions as JavaScript, so this tool is not safe
against untrusted input!

EXAMPLES
-------

Select all methods with "grant" in their name:

$ jsii-query node_modules/aws-cdk-lib --members '.method:name.includes("grant")'

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

`jsii-query` can be used for fine-grained queries on a JSII assembly.

```
jsii-query <FILE> [QUERY...]

Queries a jsii file for its entries.

Positionals:
  FILE   path to a .jsii file or directory to load                      [string]
  QUERY  a query or filter expression to include or exclude items       [string]

Options:
      --help     Show help                                             [boolean]
      --version  Show version number                                   [boolean]
  -t, --types    after selecting API elements, show all selected types, as well
                 as types containing selected members [boolean] [default: false]
  -m, --members  after selecting API elements, show all selected members, as
                 well as members of selected types    [boolean] [default: false]
  -c, --closure  Load dependencies of package without assuming its a JSII
                 package itself                       [boolean] [default: false]

REMARKS
-------

There can be more than one QUERY part, which progressively filters from or adds
to the list of selected elements.

QUERY is of the format:

    <op><kind>[:<expression>]

Where:

    <op>          The type of operation to apply
             +    Adds new API elements matching the selector to the selection.
                  If this selects types, it also includes all type's members.
             -    Removes API elements from the current selection that match
                  the selector.
             .    Removes API elements from the current selection that do NOT
                  match the selector (i.e., retain only those that DO match
                  the selector).
    <kind>        Type of API element to select. One of 'type' or 'member',
                  or any of its more specific sub-types such as 'class',
                  'interface', 'struct', 'enum', 'property', 'method', etc.
                  Also supports aliases like 'c', 'm', 'mem', 's', 'p', etc.
    <expression>  A JavaScript expression that will be evaluated against
                  the member. Has access to a number of attributes like
                  kind, ancestors, abstract, base, datatype, docs, interfaces,
                  name, initializer, optional, overrides, protected, returns,
                  parameters, static, variadic, type. The types are the
                  same types as offered by the jsii-reflect class model.

This file evaluates the expressions as JavaScript, so this tool is not safe
against untrusted input!

EXAMPLES
-------

Select all methods with "grant" in their name:

$ jsii-query node_modules/aws-cdk-lib --members '.method:name.includes("grant")'
```
@rix0rrr rix0rrr requested a review from a team October 16, 2025 12:43
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 16, 2025
@mergify
Copy link
Contributor

mergify bot commented Oct 28, 2025

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Oct 28, 2025
@mergify
Copy link
Contributor

mergify bot commented Oct 28, 2025

Merging (with squash)...

@mergify mergify bot added the queued label Oct 28, 2025
@mergify
Copy link
Contributor

mergify bot commented Oct 28, 2025

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@mergify mergify bot added dequeued and removed queued labels Oct 28, 2025
@rix0rrr rix0rrr merged commit f040d3e into main Oct 29, 2025
60 of 64 checks passed
@rix0rrr rix0rrr deleted the huijbers/jsii-query branch October 29, 2025 08:49
@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. dequeued

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants